<?

include("algoritmo_poo.php");

echo "<br><br>";
//$L = simp_subs($_POST['str']);
$t = new DerivadaClass($_POST['str']);
//$t->DefineDerivativeVariable("y");
$t->SimplifySub();
//echo "OI"; print_r( $t->L_matrix);
//echo derivada($L[4], $L);
//print_r($D);

$t->ToLatex();

$de = $t->Derivar();

$t2 = new DerivadaClass($de);
$t2->SimplifySub();
$t2->ToLatex();

echo '<img src="http://latex.codecogs.com/gif.latex?\frac{\mathrm{d} }{\mathrm{d} '.$t->derivative_variable.'}('.$t->ReplaceInLatex().') = '.$t2->ReplaceInLatex().'"/>';

?>